! function (t) {
    var e = {};

    function n(r) {
        if (e[r]) return e[r].exports;
        var o = e[r] = {
            i: r,
            l: !1,
            exports: {}
        };
        return t[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports
    }
    n.m = t, n.c = e, n.d = function (t, e, r) {
        n.o(t, e) || Object.defineProperty(t, e, {
            enumerable: !0,
            get: r
        })
    }, n.r = function (t) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
            value: "Module"
        }), Object.defineProperty(t, "__esModule", {
            value: !0
        })
    }, n.t = function (t, e) {
        if (1 & e && (t = n(t)), 8 & e) return t;
        if (4 & e && "object" == typeof t && t && t.__esModule) return t;
        var r = Object.create(null);
        if (n.r(r), Object.defineProperty(r, "default", {
                enumerable: !0,
                value: t
            }), 2 & e && "string" != typeof t)
            for (var o in t) n.d(r, o, function (e) {
                return t[e]
            }.bind(null, o));
        return r
    }, n.n = function (t) {
        var e = t && t.__esModule ? function () {
            return t.default
        } : function () {
            return t
        };
        return n.d(e, "a", e), e
    }, n.o = function (t, e) {
        return Object.prototype.hasOwnProperty.call(t, e)
    }, n.p = ".", n(n.s = 25)
}({
    0: function (t, e) {
        t.exports = function (t) {
            return t && t.__esModule ? t : {
                default: t
            }
        }
    },
    1: function (t, e, n) {
        "use strict";
        var r = n(0)(n(0));
        Object.defineProperty(e, "__esModule", {
            value: !0
        }), e.decipher = e.cipher = e.fetch_retry = e.fetchWithTimeout = void 0;
        var o = n(2),
            i = (0, r.default)(o);

        function c(t, e) {
            var n = Object.keys(t);
            if (Object.getOwnPropertySymbols) {
                var r = Object.getOwnPropertySymbols(t);
                e && (r = r.filter((function (e) {
                    return Object.getOwnPropertyDescriptor(t, e).enumerable
                }))), n.push.apply(n, r)
            }
            return n
        }

        function a(t) {
            for (var e = 1; e < arguments.length; e++) {
                var n = null != arguments[e] ? arguments[e] : {};
                e % 2 ? c(Object(n), !0).forEach((function (e) {
                    (0, i.default)(t, e, n[e])
                })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : c(Object(n)).forEach((function (e) {
                    Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
                }))
            }
            return t
        }
        var u = e.fetchWithTimeout = function (t) {
            var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
                n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 5e3,
                r = new AbortController,
                o = a({}, e, {
                    signal: r.signal
                });
            setTimeout((function () {
                r.abort()
            }), n);
            return fetch(t, o).then((function (t) {
                if (!t.ok) throw new Error("".concat(t.status, ": ").concat(t.statusText));
                return t
            })).catch((function (t) {
                if ("AbortError" === t.name) throw new Error("Response timed out");
                throw new Error(t.message)
            }))
        };
        e.fetch_retry = function t(e, n, r) {
            var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1;
            return u(e, n, r).catch((function (i) {
                if (1 === o) throw i;
                return t(e, n, r, o - 1)
            }))
        }, e.cipher = function (t) {
            var e = function (t) {
                    return t.split("").map((function (t) {
                        return t.charCodeAt(0)
                    }))
                },
                n = function (t) {
                    return ("0" + Number(t).toString(16)).substr(-2)
                },
                r = function (n) {
                    return e(t).reduce((function (t, e) {
                        return t ^ e
                    }), n)
                };
            return function (t) {
                return t.split("").map(e).map(r).map(n).join("")
            }
        }, e.decipher = function (t) {
            var e = function (e) {
                return (n = t, n.split("").map((function (t) {
                    return t.charCodeAt(0)
                }))).reduce((function (t, e) {
                    return t ^ e
                }), e);
                var n
            };
            return function (t) {
                return t.match(/.{1,2}/g).map((function (t) {
                    return parseInt(t, 16)
                })).map(e).map((function (t) {
                    return String.fromCharCode(t)
                })).join("")
            }
        }
    },
    2: function (t, e) {
        t.exports = function (t, e, n) {
            return e in t ? Object.defineProperty(t, e, {
                value: n,
                enumerable: !0,
                configurable: !0,
                writable: !0
            }) : t[e] = n, t
        }
    },
    25: function (t, e, n) {
        "use strict";
        n(8);
        var r = n(3);
        ! function () {
            for (var t = 0, e = ["TtryPlay", "Tm3PageTile", "Tm3FileUri", "Tm3FileCount", "Tm3Des1", "Tm3Des2", "Tm3Nextm3file", "Tm3Nexm3Des", "DownText", "Text", "Aria2Text", "WgetText", "UrlDecode", "Refresh"]; t < e.length; t++) {
                var n = e[t];
                (0, r.tr)(n)
            }
        }();
        new RegExp("#EXTINF:(.*),");
        var o = new RegExp("[?]m3u8_url=([^\n]*)").exec(window.location.href),
            i = o[1];
        if (o = new RegExp("\\.m3u8\\?([^\n]*)").exec(i)) var c = o[1];
        $("#m3u8_url").val(i);
        var a = i.startsWith("https://") ? "https" : "http",
            u = encodeURIComponent(i);
        $("#tryPlay").attr("href", a + "://www.cnbbx.com/player.html?url=" + encodeURIComponent(u)), $.get(i, (function (t) {
            var e = t.split("\n"),
                n = function (t) {
                    void 0 === t && (t = "");
                    var n = 0;
                    for (var o in $("#html").text(""), e) {
                        var i = e[o];
                        if (-1 != i.indexOf("URI=")) {
                            var c = /URI="(.*)"/.exec(i);
                            $("#key").html((0, r.t)("Tm3Key")), KeyURL = c[1], m(KeyURL) && ("/" == KeyURL[0] ? KeyURL = p + KeyURL : KeyURL = f + KeyURL), d(t + KeyURL)
                        } - 1 == i.indexOf("#") && "" !== i && (m(i) && (i = "/" == i[0] ? p + i : f + i), $("#num").html(++n), d(t + i), -1 != i.indexOf(".m3u8") && ($("#textarea").hide(), $("button").hide(), $("#next_m3u8_tr").show(), g(i)))
                    }
                };
            n(), $("#Text").bind("click", (function () {
                n()
            })), $("#WgetText").bind("click", (function () {
                n("wget ")
            })), $("#Aria2Text").bind("click", (function () {
                n("aria2c -c -s10 -x10 ")
            })), $("#DownText").bind("click", (function () {
                n();
                var t = $("#html").html().toString();
                t = encodeURIComponent(t);
                var e = document.createElement("a");
                e.href = "data:application/json,".concat(t), e.setAttribute("download", "m3u8.txt"), e.dispatchEvent(new MouseEvent("click"))
            })), $("#UrlDecode").bind("click", (function () {
                f = s(!1), n()
            })), $("#Refresh").bind("click", (function () {
                f = s(!0), n()
            }))
        }));
        var l, s = function (t) {
                var e = decodeURIComponent(i);
                t || (e = i);
                var n = (e = e.split("?")[0]).split("/");
                return n.pop(), "".concat(n.join("/"), "/")
            },
            f = s(!0),
            p = (l = i.split("/"), "".concat(l[0], "//").concat(l[2])),
            m = function (t) {
                return !new RegExp("^(?:[a-z]+:)?//", "i").test(t)
            },
            d = function (t) {
                !(o = new RegExp("[?]([^\n]*)").exec(t)) && c && (t = "".concat(t, "?").concat(c));
                var e = "".concat($("#html").text() + t, "\n");
                $("#html").text(e)
            },
            g = function (t) {
                $("#next_m3u8").append('<p><a href="/m3u8.html?m3u8_url='.concat(t, '">').concat(t, "</a></p>"))
            }
    },
    3: function (t, e, n) {
        "use strict";
        Object.defineProperty(e, "__esModule", {
            value: !0
        }), e.DISABLE_DOWNLOADING_FROM_YOUTUBE_REGEXP = e.supportedLanguages = e.t = e.PRE_DEF_EXTS = e.YTDLPAGE = e.HOMEPAGE = e.ISEDGE = e.PROENV = void 0, e.doInit = function () {
            if (void 0 === localStorage[c] || "" == localStorage[c]) {
                var t = new Array({
                    ext: "flv",
                    size: 10
                }, {
                    ext: "hlv",
                    size: 10
                }, {
                    ext: "f4v",
                    size: 10
                }, {
                    ext: "mp4",
                    size: 10
                }, {
                    ext: "mp3",
                    size: 10
                }, {
                    ext: "wma",
                    size: 10
                }, {
                    ext: "wav",
                    size: 10
                }, {
                    ext: "m4a",
                    size: 10
                }, {
                    ext: "webm",
                    size: 10
                }, {
                    ext: "ogg",
                    size: 10
                }, {
                    ext: "ogv",
                    size: 10
                }, {
                    ext: "acc",
                    size: 10
                }, {
                    ext: "mov",
                    size: 10
                }, {
                    ext: "mkv",
                    size: 10
                }, {
                    ext: "m3u8",
                    size: 0
                }, {
                    ext: "ts",
                    size: 1e11
                });
                localStorage[c] = JSON.stringify(t)
            }
            if (void 0 === localStorage.Type) {
                var e = new Array({
                    Type: "video/*",
                    size: 2048
                }, {
                    Type: "audio/*",
                    size: 10
                });
                localStorage.Type = JSON.stringify(e)
            }
            if (void 0 === localStorage.BlockedDomains) {
                var n = new Array;
                localStorage.BlockedDomains = JSON.stringify(n)
            }
            void 0 === localStorage.repeat && (localStorage.repeat = !1);
            void 0 === localStorage.repeatReg && (localStorage.repeatReg = "\\?[\\S]+");
            void 0 === localStorage.Debug && (localStorage.Debug = !1);
            void 0 === localStorage.TitleName && (localStorage.TitleName = !1);
            void 0 === localStorage.popListCount && (localStorage.popListCount = 30);
            void 0 === localStorage.showCountOnIcon && (localStorage.showCountOnIcon = !0)
        }, e.tr = function (t) {
            $("#" + t).html(a(t))
        }, e.getLanguage = l, e.getExtManifest = function () {
            return o.runtime.getManifest()
        }, e.isActivePro = p, e.getLoaderUrl = function () {
            var t, e, n = l(),
                r = "://www.cnbbx.com/";
            t = "other" != n ? "hls.html" : "ohls.html";
            p() && (r = "://www.cnbbx.com/", t = "hls.vhtml", "other" == n && (t = "ohls.vhtml"));
            e = i ? r + (u.includes(n) ? n + "/" : "") + t : "://127.0.0.1/" + t;
            return e
        }, e.getDLMUrl = function () {
            var t, e, n = l(),
                r = "://www.cnbbx.com/";
            t = "other" != n ? "dlm.html" : "odlm.html";
            p() && (r = "://www.cnbbx.com/", t = "dlm.vhtml", "other" == n && (t = "odlm.vhtml"));
            e = i ? r + "dlm/" + (u.includes(n) ? n + "/" : "") + t : "://127.0.0.1/dlm/" + t;
            return e
        };
        var r = n(1),
            o = navigator.userAgent.includes("Chrome") ? chrome : browser,
            i = e.PROENV = !0;
        e.ISEDGE = !1, e.HOMEPAGE = void 0, e.YTDLPAGE = void 0;
        i ? (e.HOMEPAGE = "https://www.cnbbx.com", e.YTDLPAGE = "https://www.cnbbx.com/yt/") : (console.log("dev env"), e.HOMEPAGE = "http://127.0.0.1", e.YTDLPAGE = "http://127.0.0.1");
        var c = e.PRE_DEF_EXTS = "Ext04";
        o.browserAction.setIcon({
            path: {
                16: "assets/icons/16x16_gray.png",
                32: "assets/icons/32x32_gray.png",
                48: "assets/icons/48x48_gray.png",
                64: "assets/icons/64x64_gray.png",
                128: "assets/icons/128x128_gray.png"
            }
        });
        var a = e.t = o.i18n.getMessage;
        var u = e.supportedLanguages = ["zh_tw", "zh_cn"];

        function l() {
            var t = o.i18n.getUILanguage();
            return t.match(/zh-CN/) ? "zh_cn" : t.match(/zh-TW/) ? "zh_tw" : t.startsWith("zh") ? "zh_cn" : t.startsWith("en") ? t.substr(0, 2) : "other"
        }
        if (o.runtime.onInstalled.addListener((function (t) {
                var e = l(),
                    n = "https://www.cnbbx.com/" + (u.includes(e) ? e + "/" : "") + "installed.html";
                localStorage.getItem("installed") || o.tabs.create({
                    url: n
                }, (function (t) {
                    console.log("Hi, wellcome:)"), localStorage.setItem("installed", "t")
                }))
            })), o.runtime.setUninstallURL) {
            var s = l(),
                f = "https://www.cnbbx.com/" + (u.includes(s) ? s + "/" : "") + "uninstalled.html";
            o.runtime.setUninstallURL(f)
        }
        e.DISABLE_DOWNLOADING_FROM_YOUTUBE_REGEXP = /^https?:\/\/www\.youtube\.com\//;

        function p() {
            if (localStorage.getItem("pui") && "active" == (0, r.decipher)("CocoCut pro user")(localStorage.getItem("pui")).split("|")[3]) return !0;
            return !1
        }
    },
    8: function (t, e, n) {}
});